from django.conf import settings
from django.core.mail import send_mail
from celery_tasks.main import celery_app

@celery_app.task(name="send_active_email")
def send_active_email(to_email,verify_url):
    """
       发送验证邮箱邮件
       :param to_email: 收件人邮箱
       :param verify_url: 验证链接
       :return: None
       """
    subject = "迪拜富人榜"
    html_message = '<p>大哥您好！</p>' \
                   '<p>恭喜您加入迪拜富人圈。</p>' \
                   '<p>您的邮箱为：%s 。请点击此链接激活您的邮箱从而感受优质服务：</p>' \
                   '<p><a href="%s">%s<a></p>' % (to_email, verify_url, verify_url)
    send_mail(subject, "", settings.EMAIL_FROM, [to_email], html_message=html_message)